export function deepCopy (obj) {
  if (!(obj instanceof Object)) {
    return obj
  }
  if (obj instanceof Array) {
    let result = []
    for (let i = 0; i < obj.length; i++) {
      result[i] = deepCopy(obj[i])
    }
    return result
  } else {
    let result = {}
    for (let key in obj) {
      result[key] = deepCopy(obj[key])
    }
    return result
  }
}
